//
//  BaseTableViewController.m
//  DefendHealth
//
//  Created by UNOHACHA on 17/2/20.
//  Copyright © 2017年 iMacOne. All rights reserved.
//

#import "BaseTableViewController.h"

@interface BaseTableViewController ()

@end

@implementation BaseTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.tableView = [[UITableView alloc]initWithFrame:self.tableView.frame style:UITableViewStyleGrouped];
    
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    
    self.tableView.showsVerticalScrollIndicator = NO;
    self.tableView.showsHorizontalScrollIndicator = NO;
    self.tableView.backgroundColor = k_TableBackColor;
    
    
    
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}


- (UIView *)baseNavView {
    
    UIView * Nav = [[UIView alloc] initWithFrame:CGRectMake(0, 0, WindowWidth, 64)];
    Nav.backgroundColor = kWhiteColor;
    [self.view addSubview:Nav];
    
    
    UILabel *TitleNav = [[UILabel alloc] initWithFrame:CGRectMake((WindowWidth-200)/2, 20, 200, 44)];
    TitleNav.font = [UIFont fontWithName:@"Helvetica-Bold" size:18];
    self.TitleNav = TitleNav;
    TitleNav.textColor = UIColorFromRGB(0x333333);
    TitleNav.backgroundColor = [UIColor clearColor];
    TitleNav.textAlignment = NSTextAlignmentCenter;
    [Nav addSubview:TitleNav];
    
    
    
    UIButton *leftbutton = [UIButton buttonWithType:UIButtonTypeCustom];
    leftbutton.frame = CGRectMake(0, 20, 60, 44);
    self.leftbutton = leftbutton;
    [leftbutton setImage:IMAGE(@"left") forState:UIControlStateNormal];
    [leftbutton addTarget:self action:@selector(leftBaseTabEvents) forControlEvents:UIControlEventTouchUpInside];
    
    [Nav addSubview:leftbutton];
    
    UIButton *rigltbutton = [UIButton buttonWithType:UIButtonTypeCustom];
    rigltbutton.frame = CGRectMake(WindowWidth-60, 20, 60, 44);
    self.rigltbutton = rigltbutton;
    [rigltbutton setTitleColor:UIColorFromRGB(0x666666) forState:UIControlStateNormal];
    [rigltbutton addTarget:self action:@selector(rightBaseTabEvents) forControlEvents:UIControlEventTouchUpInside];
    rigltbutton.titleLabel.font=FONT(15);
    //    _rigltbutton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    //    _rigltbutton.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 10);
    
    [Nav addSubview:rigltbutton];

    
    return Nav;
}


- (void)leftBaseTabEvents {
    
    [self.navigationController popViewControllerAnimated:YES];
    
}

- (void)rightBaseTabEvents {
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source


- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    
    return 0.1f;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 0.01f;
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
//#warning Incomplete implementation, return the number of sections
    return 1;
}
//
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//#warning Incomplete implementation, return the number of rows
//    return 0;
//}

/*
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
    
    // Configure the cell...
    
    return cell;
}
*/

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
